<template>
  <div>
    <!-- 头部 -->
    <van-nav-bar title="设备检测" fixed>
      <template #left>
        <img
          src="../../assets/images/设备检测箭头.png"
          alt=""
          @click="prev()"
        />
      </template>
    </van-nav-bar>
    <!-- 中间 -->
    <div class="middle">
      <div class="border">
        <img class="box" src="../../assets/images/设备边框.png" alt="" />
        <p>开始检测后，记得开启相机和麦克风的访问权限哦!</p>
        <div class="camera">
          <img class="box1" src="../../assets/images/摄像头.png" alt="" />
          <span>摄像头</span>
        </div>
        <div class="voice">
          <img class="box2" src="../../assets/images/麦克风.png" alt="" />
          <span>麦克风</span>
        </div>
        <div class="loudspeaker">
          <img class="box3" src="../../assets/images/扬声器.png" alt="" />
          <span>扬声器</span>
        </div>
      </div>
    </div>
    <div class="footer">
      <button class="btn" @click="begin">开始检测</button>
    </div>
  </div>
</template>

<script>
import { NavBar, Dialog, Toast } from "vant";
export default {
  components: {
    vanNavBar: NavBar,
  },
  methods: {
    prev() {
      this.$router.go(-1);
    },
    begin() {
      Dialog.confirm({
        title: "确定要开始检测吗",
        // message: "弹窗内容",
      })
        .then(() => {
          Toast.loading({
            message: "加载中...",
            forbidClick: true,
          });
          setTimeout(() => {
            Toast.success("检测成功");
          }, 2000);
        })
        .catch(() => {
          Toast.fail("检测失败");
        });
    },
  },
};
</script>

<style lang="less" scoped>
.van-nav-bar {
  background: #3b98ff !important;
}
.van-hairline--bottom::after {
  border-bottom: none !important;
}
/deep/.van-nav-bar__title {
  color: #fff !important;
  font-size: 16px !important;
}
.van-nav-bar__left {
  img {
    width: 7px;
    height: 11px;
  }
}
.middle {
  background: #3b98ff;
  height: 462px;
  margin-top: 46px;

  .border {
    position: relative;
    .box {
      margin: 46px 25px;
      width: 324px;
      height: 379px;
      background: radial-gradient(circle, #0097fe, #56d6fb, #1bd0fe);
      box-shadow: 0px 0px 10px #000;
      border-radius: 23px;
      position: absolute;
    }
    p {
      position: absolute;
      font-weight: 600;
      top: 80px;
      left: 69px;
      width: 238px;
      height: 39px;
      font-size: 18px;
      text-align: center;
    }
    .camera {
      .box1 {
        height: 53px;
        width: 47px;
        position: relative;
        left: 107px;
        top: 160px;
      }
      span {
        position: absolute;
        top: 180px;
        right: 109px;
        font-size: 16px;
        color: #ccc;
        font-weight: 600;
      }
    }
    .voice {
      .box2 {
        height: 53px;
        width: 47px;
        position: relative;
        left: 107px;
        top: 180px;
      }
      span {
        position: absolute;
        top: 255px;
        right: 109px;
        font-size: 16px;
        color: #ccc;
        font-weight: 600;
      }
    }
    .loudspeaker {
      .box3 {
        height: 53px;
        width: 47px;
        position: relative;
        left: 115px;
        top: 195px;
      }
      span {
        position: absolute;
        top: 330px;
        right: 109px;
        font-size: 16px;
        color: #ccc;
        font-weight: 600;
      }
    }
  }
}
.footer {
  height: 160px;
  width: 100%;
  background: url("../../assets/images/矩形6.png");
  .btn {
    width: 300px;
    height: 45px;
    margin: 37px;
    border-radius: 34px;
    color: #fff;
    background: #00b1ff;
    border: none;
  }
}
</style>
